<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:70:"/home/wwwroot/www.xgw0851.com/application/index/view/coupon/index.html";i:1523366691;s:69:"/home/wwwroot/www.xgw0851.com/application/index/view/public/base.html";i:1530280572;}*/ ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title><?php echo $title; ?></title>
<link rel="stylesheet" href="__PUBLIC__/xsd/css/mui.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/icons-extra.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/app.css?v1111121" />

</head>
<!--/head-->
<body>


	<!--/header-->

<link rel="stylesheet" type="text/css" href="__PUBLIC__/xsd/css/checkout.css" />
<header class="mui-bar mui-bar-nav" style="z-index:7">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">优惠券</h1>
</header>
<div class="mui-content ">
<style>
/* 使用代金券 */
#cart_voucher { margin-bottom: -50px; }
.my-coupons-mask { position: fixed; top: 0; left: 0; display: none;  width: 100%; height: 100%; background: #FFF; z-index: 9998;}
.my-coupons-wrap { display: none;  width: 100%;  height: 100%;  padding-top: 8px;  overflow-y: scroll;  background: #f1f1f1; z-index: 9999; }
.my-coupons-top { width: 100%; height: auto; }
.my-coupons-top h1 { padding:  0 8px; font-size: 1.2em; font-weight: normal; color: #57b174; line-height: 2; }
.my-coupons-top div.my-coupons-top-table-wrap { margin-top:1%; margin-bottom: 0.5%;  padding: 2% 8px; background: #FFF; }
.my-coupons-top div.my-coupons-top-table-wrap table { width: 100%; }
.my-coupons-top div.my-coupons-top-table-wrap table input { width: 80%; border-width:  0; font-size: 16px; }
.my-coupons-top div.my-coupons-top-table-wrap table tr td.secord-child { width: 60px;  min-width: 60px; max-width: 60px; }
.my-coupons-top div.my-coupons-top-table-wrap table a { display: block; float: right; margin-right: 8px; width: 20%;    min-width: 55px; text-align: center; line-height: 32px; border-radius: 40px; color: #FFF;  background: #32b16c; font-size: 1em; }
.my-coupons-top div.my-coupons-top-table-wrap table a:hover,.my-coupons-top div table a:active,.my-coupons-top div table a:visited { color: #FFF; }

.my-coupons { padding: 0 8px; }
.my-coupons-header ul { width: 100%; padding-bottom: 5px;  border-bottom: solid 1px #57b174; overflow: hidden;  }
.my-coupons-header ul li { float: left; width: 49%; text-align: center; color: #474747; }
.my-coupons-header ul li.current { color: #57b174; }
.my-coupons-header ul li.border { border-right: solid 1px #57b174; }

.my-coupons-main { padding-bottom: 10px; }
.my-coupons-main ul { padding-top: 3px; margin-bottom: 6px; }
.my-coupons-main ul li { background: #FFF; border: solid 1px #CCC;  }
.my-coupons-main ul li.current {  border: solid 1px #57b174; }
.my-coupons-main ul li { position: relative; padding:0;  margin-top: 8px;   overflow: hidden;}
.my-coupons-main ul li h1 { padding-top: 5px; margin-bottom: 3px; font-size: 0.875em; font-weight: normal; color: #343434;}
.my-coupons-main ul li div.loading-box{ width: 25%; float: left; }
.my-coupons-main ul li div.voucher-img { position: relative; }
.my-coupons-main ul li img{ width: 100%;}
.my-coupons-main ul li p { margin: 0; font-size: 0.75em; text-align: left; line-height: 1.5; color: #9b9b9b;  }
.my-coupons-main ul li p.date em { float:right; display: none; margin-right: 5%; width: 11px; height: 11px; border-radius: 100%; background: #57b174; }
.my-coupons-main ul li.current p.date em { display: block; font-style: normal; }
.my-coupons-main ul li a { display: block;  padding: 8px;   overflow:  hidden; }
.my-coupons-main ul li a.cancel-border { padding-left: 8spx; border: none; }
.my-coupons-main ul li div.user-voucher-info { float: right; width: 70%; }

.my-coupons-main ul li span.tips { position: absolute; right: 8px; top: 10px; padding: 3px 5px; font-size: 0.625em; color: #e90e0e;background: #57b174; color: #FFF; }
.my-coupons-main ul li span.new { position: absolute; right: -10px; top: 0px; padding: 3px 5px; font-size: 0.625em; color: #ff3ec2;background: #ff3ec2; color: #FFF; }

.my-coupons-gift-main {  display: none; width: 100%; padding-bottom: 50px; }
.my-coupons-gift-main dl { width: 80%; margin: 25px auto; }
.my-coupons-gift-main dl dt { padding-bottom: 0px;  border-bottom: solid 1px #cac9c9; }
.my-coupons-gift-main dl dt input { display: block; width: 100%; margin: 0 auto; border-width: 0;  text-align: center; font-weight: normal; color: #a5a5a5; font-size: 1.1em; line-height: 25px; }
.my-coupons-gift-main dl dd.code-tips {  text-align: center; font-size: 0.875em; margin-bottom: 20px;  margin-top: 6px; color: #aaa;}
.my-coupons-gift-main a { display: block; width: 80%;  height: 40px; line-height: 40px; margin: 0 auto; text-align:  center;   background: #57b174; border-radius: 30px; color: #FFF; }

.my-coupons-footer {  position: fixed; bottom: 0; left: 0; display: none; width: 100%; height: 50px; background: #fcfaec; z-index: 9999;}
.my-coupons-footer img { display: block; height: 40px; margin: 5px auto; }
.cart_voucher_item_inner { padding: 8px; overflow: hidden;}

.column-content{ overflow:hidden; padding:10px;border-top:1px solid #ddd;}
.column-content .img{ width:20%; float:left;}
.column-content .img img{ width:100%;}
.column-content .img i{ font-style:normal; color:#FFF; width:100%; height:100%; display:block; line-height:500%; text-align:center}
.column-content .img i.sale5{ background:#04c7bf}
.column-content .img i.sale10{ background:#ffa619}
.column-content .img i.sale20{ background:#ff7878}
.column-content .img i.sale50{ background:#7bb954}
.column-content .info{ overflow:hidden; float:left; width:75%; margin-left:5%}
.column-content .info p{ line-height:150%; vertical-align:middle}
.column-content .info .title{ color:#555}
.column-content .info .jg{ color:#999}
.column-content .info .fen{ color:#57b174}
.column-content .info .number{ color:#F00; text-align:right}
.column-content .info .set{ color:#999; text-align:right; line-height:150%; vertical-align:middle; margin-top:10px;}
.column-content .info .set span{ color:#F00}

.button{
width: 220px;
line-height: 38px;
text-align: center;
font-weight: bold;
color: #fff;
text-shadow:1px 1px 1px #333;
border-radius: 5px;
margin:0 20px 20px 0;
position: relative;
overflow: hidden;
}

.button.red{
border:1px solid #b42323;
box-shadow: 0 1px 2px #e99494 inset,0 -1px 0 #954b4b inset,0 -2px 3px #e99494 inset;
background: -webkit-linear-gradient(top,#d53939,#b92929);
background: -moz-linear-gradient(top,#d53939,#b92929);
background: linear-gradient(top,#d53939,#b92929);
}
.button.yellow{
border:1px solid #d2a000;
box-shadow: 0 1px 2px #fedd71 inset,0 -1px 0 #a38b39 inset,0 -2px 3px #fedd71 inset;
background: -webkit-linear-gradient(top,#fece34,#d8a605);
background: -moz-linear-gradient(top,#fece34,#d8a605);
background: linear-gradient(top,#fece34,#d8a605);
}
</style>
  <div class="box">
  	<!--
            <div class="my-coupons-top" style="display:none;" >
                <h1>请输入优惠码或选择优惠券</h1>
                <div class="my-coupons-top-table-wrap">
                    <div>
                        <table>
                            <tbody>
                                <tr>
                                    <td>
                                        <input type="text" id="voucher_code" placeholder="请输入礼券密码/邀请码" value="" onfocus="cart.voucher_input_change()" style="margin-bottom:0">
                                    </td>
                                    <td class="secord-child"><a href="javascript:void(0);" title="确定" onclick="check_voucher_code()">确定</a></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            -->

            	<?php if($cartCountprice==0): ?>
 <div class="tab_box">
 	<a href='http://www.xgw0851.com'><button style="text-align:center;margin-left:auto;margin-right:auto;margin-top:20px;" type="button" class="button yellow">进入商城</button>
 </a>
 </div>


<?php endif; ?>
                <div class="tab_box">
                <div>

                  <?php if(empty($list) || ($list instanceof \think\Collection && $list->isEmpty())): ?>
                    <h1 style="color: #a8a8a8;font-size: 1em;text-align: center;font-weight: normal;margin-top:60px;">您还没有可以使用的优惠券</h1>
                  <?php else: if(is_array($list) || $list instanceof \think\Collection): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>

                     <div class="column" data-listid="<?php echo $vo['id']; ?>" data-total="<?php echo $vo['total']; ?>">
                           <div class="column-content">
                               <p class="img"><i class="sale<?php echo $vo['price']; ?> small"><?php echo $vo['price']; ?>元</i></p>
                               <div class="info">
                                   <?php if($vo['coupon_id'] == '1'): ?>
                                    <p class="large">新用户<?php echo $vo['price']; ?>元欢迎礼券</p>
                                   <?php endif; ?>
                                   <p class="large"><?php echo $vo['coupon_dec']; ?></p>
                                   <p class="jg small"><span>到期:</span><span><?php echo $vo['deadline']; ?></span> </p>
                                   <p class="jg small"><span>规则:</span><span >消费满<?php echo $vo['total']; ?>元抵扣<?php echo $vo['price']; ?>元</span></p>
                              </div>
                           </div>
                       </div>
                   <?php endforeach; endif; else: echo "" ;endif; endif; ?>


                </div>
            </div>
  </div>
    <!--box end-->

    &nbsp;&nbsp;<div> <p> 优惠卷 在购买商品以后 在支付页面中点击优惠卷既可以使用优惠卷</p></div>
</div>



<!--/#footer-->

<script src="__PUBLIC__/js/jquery.js"></script>
<script src="__PUBLIC__/xsd/js/mui.min.js"></script>
<script src="__PUBLIC__/xsd/js/flexible.js"></script>
<script src="__PUBLIC__/xsd/js/template.js"></script>

  <script type="text/javascript">
    $(function(){
      $('#add').on('click',function(){
        window.location.href = "<?php echo url('index/address/add'); ?>"
      })

      $('.column').click(function(){
        var $this = $(this),id = $this.attr('data-listid'),total = parseInt($this.attr('data-total')),cartCountprice = parseInt("<?php echo $cartCountprice; ?>")
        if(cartCountprice  >= total){
            $.getJSON("<?php echo url('index/cart/changecookie'); ?>", {name: 'couponlist_id', 'val': id}, function(json, textStatus) {
              mui.toast('设置成功！')
              self.location=document.referrer;
            });

        }else{
          mui.toast('购物车商品未消费满'+total)
        }
      })




    })
  </script>

<?php if(!(empty(config('shop_hours')) || (config('shop_hours') instanceof \think\Collection && config('shop_hours')->isEmpty()))): ?>
<script>
  var time_range = function (beginTime, endTime) {
    var strb = beginTime.split (":");
    if (strb.length != 2) {
      return false;
    }

    var stre = endTime.split (":");
    if (stre.length != 2) {
      return false;
    }

    var b = new Date ();
    var e = new Date ();
    var n = new Date ();

    b.setHours (strb[0]);
    b.setMinutes (strb[1]);
    e.setHours (stre[0]);
    e.setMinutes (stre[1]);

    if (n.getTime () - b.getTime () > 0 && n.getTime () - e.getTime () < 0) {
      return true;
    } else {

      mui.alert("<?php echo config('shop_hours_message'); ?>", '公告');
      $('.mui-popup-buttons').html(' ')
      $('.mui-popup-inner').css('border-radius', '13px')
      return false;
    }
  }

  var shop_hours = "<?php echo config('shop_hours'); ?>";
  var hours_arr = shop_hours.split('-');
  time_range (hours_arr[0], hours_arr[1]);

</script>
<?php endif; if(config('is_rest') == '1'): ?>
<script>
mui.alert("<?php echo config('rest_message'); ?>", '公告');
$('.mui-popup-buttons').html(' ')
$('.mui-popup-inner').css('border-radius', '13px')
</script>
<?php endif; if(empty(\think\Cookie::get('positioninit')) || (\think\Cookie::get('positioninit') instanceof \think\Collection && \think\Cookie::get('positioninit')->isEmpty())): ?>
<script type="text/javascript" src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
<script>
   var geolocation = new qq.maps.Geolocation("QQ6BZ-24HC6-ZAXSZ-MTZAU-5MU2J-HEFEH", "鲜果屋");
    geolocation.getIpLocation(showPosition, showErr)
    function showPosition(position) {
      $.getJSON("<?php echo url('index/cart/changecookie'); ?>", {name: 'positioninit', 'val': position.lat+','+position.lng}, function(json, textStatus) {});
    };
    function showErr() {
      console.log('定位失败');
    };
</script>
<?php endif; ?>


<script>
  $(function(){
    $('.subsc').click(function(){
      // $.get("<?php echo url('index/clearusersession'); ?>", function(data){
      //   if(data.code == 1){
      //     window.location.href = "http://mp.weixin.qq.com/s/-AzpDTU7eAD24-R5QUP0wg"
      //   }
      // })
      //cookie('goodsmodel_id', $model_id);
      <?php switch(cookie('goodsmodel_id')): case "1":case "2":case "3": ?>
            mui.alert("<img src=<?php echo get_cover(config('frankserviceimg'), 'path'); ?> style='width:100%;'>", '长按扫二维码');
        <?php break; endswitch; if(!(empty($contact_qc) || ($contact_qc instanceof \think\Collection && $contact_qc->isEmpty()))): ?>
            mui.alert('<img src="<?php echo $contact_qc; ?>" style="width:100%;">', '长按扫二维码');
      <?php endif; ?>
    })


    $('.endlimit').each(function(){
      var $this = $(this);
      var stime = $this.attr('data-endtime');
      var starttime = new Date(stime.replace(/-/g,"/"))
      setInterval(function () {
        var nowtime = new Date();
        var time = starttime - nowtime;
        if(time > 0){
          var day = parseInt(time / 1000 / 60 / 60 / 24);
          var hour = parseInt(time / 1000 / 60 / 60 % 24);
          var minute = parseInt(time / 1000 / 60 % 60);
          var seconds = parseInt(time / 1000 % 60);
          $this.html("距结束还有:<span style='color:red'>"+ day + "天" + hour + "小时" + minute + "分钟" + seconds + "秒</span>");
        }

      }, 1000);
    })

    $('.hidecartbtn').each(function(){
      var id = $(this).attr('data-id')
      $('.cartbtn'+id).hide();
    })


  })
</script>
</body>
</html>
